#ifndef _DRAFT_
#define  _DRAFT_



const int FRAME_VECTOR_SIZE = 20;
typedef enum{video_type, audio_type} AV_TYPE;

struct AVAudioFrame
{
	uint8_t * data;
	int length;
};

class AVdataBuffer
{
public:
	AVdataBuffer(AV_TYPE avtype);
	~AVdataBuffer();

	bool  AllocPicture(PixelFormat fmt, int w, int h);
	bool  AllocAudio(int len);
	AVPicture*  GetPicture();
	AVAudioFrame* GetAudio();

private:
	AVPicture* m_Video;
	AVAudioFrame* m_Audio;
	AV_TYPE m_avType;
	uint8_t* m_pdata;
};




class CBoList
{

};


class CAVOption
{
	
private:
	char* m_szProfileName;

	char* m_szfileExt;
	int m_dstW;
	int m_dstH;
	int m_videoBitRate;
	PixelFormat m_dstPixFmt;
	
	int m_audioBitRate;
	int m_audioChannel;
	int m_audioSampleRate;	
	
};



class CDsOption
{
	
private:
	int m_srcW;
	int m_srcH;
	PixelFormat m_srcPixFmt;
};



class CFramePool
{
public:
	bool SetDsMediaType(CMediaType* pmt);
	bool SetEncParam(CAVOption* param);

	bool Push(IMediaSample* pSample);
	AVFrame* GetEncFrame();
private:
	bool getVideo(IMediaSample* pSample, AVFrame* pFrame);
	bool getAudio(IMediaSample* pSample);

private:
	CDsOption m_dsOption;

};


class CLibffmpeg
{
public:
	bool BeforeCompress();
	bool Compress();
	bool EndCompress();
};


#endif